Skip to content

Migrate integration tests to testcontainers #252

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Aug 21, 2024

Conversation

ndepaola
Copy link
Collaborator

Description

  • Had a few mins spare tonight, so I thought I'd clean up our test configuration a bit to spin up postgres and elasticsearch with testcontainers
  • Build time is about the same but github actions is less hacky + running the tests doesn't overwrite data in your local elasticsearch instance anymore

Checklist

  • I have installed pre-commit and installed the hooks with pre-commit install before creating any commits.
  • I have updated any related tests for code I modified or added new tests where appropriate.
  • I have manually tested my changes as follows:
    • No manual testing required
  • I have updated any relevant documentation or created new documentation where appropriate.
    • None required

...this ordering should be consistent going forward.

(postgres query tie-break ordering varies by operating system)
@ndepaola ndepaola self-assigned this Aug 21, 2024
@@ -54,7 +54,7 @@ def __init__(self) -> None:

def get_elasticsearch_connection() -> Elasticsearch:
if (es := getattr(thread_local, "elasticsearch", None)) is None:
es = Elasticsearch([settings.ELASTICSEARCH_HOST], port=9200)
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yuck, who wrote this 🗿

@ndepaola ndepaola merged commit 46a457c into master Aug 21, 2024
2 checks passed
@ndepaola ndepaola deleted the migrate-integration-tests-to-testcontainers branch August 21, 2024 14:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant